home *** CD-ROM | disk | FTP | other *** search
- /*
- File: AEDaemon.h
-
- Contains:
-
- Written by:
-
- Copyright: Copyright © 1991-1999 by Apple Computer, Inc., All Rights Reserved.
-
- You may incorporate this Apple sample source code into your program(s) without
- restriction. This Apple sample source code has been provided "AS IS" and the
- responsibility for its operation is yours. You are not permitted to redistribute
- this Apple sample source code as "Apple sample source code" after having made
- changes. If you're going to re-distribute the source, we require that you make
- it clear in the source that the code was descended from Apple sample source
- code, but that you've made changes.
-
- Change History (most recent first):
- 7/20/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
-
-
- */
- #include <Types.h>
- #include <Memory.h>
- #include <Quickdraw.h>
- #include <TextEdit.h>
- #include <Dialogs.h>
- #include <Devices.h>
- #include <Scrap.h>
- #include <menus.h>
- #include <PPCToolbox.h>
- #include <AppleEvents.h>
- #include <StandardFile.h>
- #include <EPPC.h>
- #include <Aliases.h>
- #include <events.h>
- #include <gestaltequ.h>
- #include <ToolUtils.h>
-
- /* Types */
- struct MyPPCRec {
- PPCParamBlockRec pB;
- Ptr buffer; /* buffer we're using */
- Size bufferSize; /* guess */
- Handle dataToXfer;
- PPCPortPtr myPort;
- PPCPortPtr buddyPortPtr;
- PPCPortRefNum ourPort;
- PPCSessRefNum currentSessionRef;
-
- };
- typedef struct MyPPCRec MyPPCRec, *MyPPCRecPtr,**MyPPCRecHandle;
-
-
- typedef struct CDEVRec {
- Handle spare;
- MyPPCRecPtr myPPCBlock;
- /* LocationName won't be needed, since we're staying local */
- Boolean searchForTarget; /* searchForTarget is our flag to tell us that we do not */
- /* know where AEBuddy is yet, and we have to keep looking. */
- /* It also implies (if true) that PBCat has already been */
- /* called, if necessary */
- Boolean noBuddy; /* PBCatSearch failed, give it up */
- Boolean notSys7;
- Boolean eventPending;
- } CDEVRec, *CDEVPtr, **CDEVHnd;
-
-
- struct MyPPCRecDeamon { /* to differentiate it from the one I'm using in the CDEV */
- PPCParamBlockRec pB;
- Ptr buffer; /* buffer we're using */
- Size bufferSize; /* guess */
- Handle dataToXfer;
- PPCPortPtr myPort;
- PPCPortRefNum ourPort;
- PPCSessRefNum currentSessionRef;
- };
-
- typedef struct MyPPCRecDeamon MyPPCRecDeamon, *MyPPCRecPtrDeamon,**MyPPCRecHandleDeamon;
-
-
- #define kOneK 1024
- #define kSendButton 1
- #define kNoBuddyAlert -4048
- #define kNot70 -4049
- #define kStringsID -4048
- #define kBrowse1 1
- #define kBrowse2 2
- #define kMyName 3
- #define kWatchCursor 4
-
- enum {
- kMyTypeOfData = 0x4D415654, // 'MAVT'
- kGenericCreator = 0x3F3F3F3F // '????'
- };
-
-
- void InitAEStuff(void);
- void DoHighLevel(EventRecord *AERecord);
- pascal OSErr AEOpenHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
- pascal OSErr AEOpenDocHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
- pascal OSErr AEPrintHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
- pascal OSErr AEQuitHandler(AppleEvent *messagein, AppleEvent *reply, long refIn);
- Boolean InformTheWorld(void);
- OSErr OpenAPort(PPCOpenPBPtr myPort);
- Boolean DoInform(PPCInformPBPtr p);
- void CloseOffTheWorld(void);
- void OpenComplete(PPCInformPBPtr p);
- void InformComplete(PPCReadPBPtr p);
- void ReadComplete(PPCReadPBPtr p);
- void CollectLastData(void);
-
-